#include <iostream>
using namespace std;

class Array
{
private:
    int capcity;
    int size;
    int *array;

public:
    Array();
    Array(const Array &arr);
    ~Array();
    int getsize();
    int getvalue(int temp);
    void pushback(int value);
    void sertvalue(int temp,int value);
    void deletevalue(int temp);
    void add();
    void deletel(int arr[],int len);

};
void Array::deletel(int arr[],int len){
    for(int j=0;j<len;j++){
        int temp;
        temp=arr[len-1-j];
        for(int i=temp;i<this->size-1;i++){
            this->array[i]=this->array[i+1];
        }
        this->size--;
    }
}

void Array::add()
{
    int a;
    cout<<"输入加入数据的数量"<<endl;
    cin>>a;
    for (int i=0;i<a;i++){
        int b;
        cout<<"输入加入的第"<<i+1<<"个数据"<<endl;
        cin>>b;
        this->array[this->size]=b;
        this->size++;
        cout<<this->size<<endl;
    }
}


void Array::deletevalue(int temp){
    for(int i=temp;i<this->size-1;i++){
        this->array[i]=this->array[i+1];
    }
    this->size--;
}
//修改函数
void Array::sertvalue(int temp,int value){
    this->array[temp]=value;
}

void Array::pushback(int value){
    this->array[this->size]=value;
    this->size++;
}

int Array::getsize(){
    return this->size;
}

int Array::getvalue(int temp){
    return this->array[temp];
}

Array::Array(){
    this->capcity=100;
    this->size=0;
    this->array=new int [this->capcity];
}

Array::Array(const Array &arr){
    this->capcity=arr.capcity;
    this->size=arr.size;
    this->array=new int [this->capcity];    

}

Array::~Array(){
    delete []this->array;
}



int main(){
    Array arr;
    int a[2]={1,2};
    arr.pushback(0);
    arr.pushback(1);
    arr.pushback(2);
    arr.pushback(3);
    //arr.add();
    //arr.deletevalue(0);
    arr.deletel(a,2);
    cout<<"数组为："<<endl;
    for(int i=0;i<arr.getsize();i++){
        cout<<arr.getvalue(i)<<" ";
    }
    cout<<endl;
    cout<<"数据个数:"<<arr.getsize()<<endl;
}